import Vue from 'vue'
import App from './App'
import store from './store/store.js'
import {$http} from '@escook/request-miniprogram'
//uni-app 項目uni表示頂級對象,將内容挂載到上面,在任意地方使用
uni.$http = $http
//配置请求基础路基
$http.baseUrl = 'https://api-hmugo-web.itheima.net'

$http.beforeRequest = function(options) {
  uni.showLoading({
    title: '数据加载中...',
  })
}

$http.afterRequest = function() {
  uni.hideLoading()
}
uni.$shoewToast=function(title="数据出错了",duration=1000,icon='none') {
  uni.showToast({
    icon,
    title,
    duration
  })
}
Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
  ...App,
  store
})
app.$mount()